package com.application.fabric.fabriccontrol.existevidence;

import com.application.fabric.fabriccontrol.config.PDFmsg;
import com.application.fabric.users.entity.Evidence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class PDFService {

    @Resource
    private PDFmsg pdFmsg;
    @Autowired
    private getcacert getcacert;
    @Autowired
    private CreatePDF createPDF;
    public void uploadce(Evidence evidence) throws Exception {
//        信息获取


        //               hadoopTemplate.writer(hdfspath,evidence.getFile().getInputStream());
////               证书上传
               pdFmsg.setHashid(evidence.getExithash());
               pdFmsg.setTime(evidence.getTime());
               pdFmsg.setPdfname(evidence.getUserid());
               pdFmsg.setBlockaddress(evidence.getAssetid());
//               admin为例子
               pdFmsg.setCertificate(getcacert.cacermbase64());
               createPDF.writehdfs();
    }


}
